package com.dgut.epidemic.mapper;

import com.dgut.epidemic.pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

/**
 * Author: wuhaoduan
 * Date: 2021/6/4 16:38
 */
@Mapper
@Repository
public interface UserMapper {
    //获得管理员用户姓名
    String getUserName(int id);

    //获得Spring Security所需的数据
    Optional<User> findUserByName(String username);

    //通过username获得User
    User getUserNowByUserName(String username);

    //更新User
    void updateUser(User user);

    //新增User
    void insertUser(User user);

    //查询User的username是否已被占用
    int judgeUserNameIsExist(String username);

    //获得全部User
    List<User> getAllUser();

    //删除User
    void deleteUser(String id);
}
